from argparse import ArgumentParser
from mat import read_tsv

def main(args):
    bow = read_tsv(args.data)
    bow = bow[:1]
    print('read finished')

    if args.method == 'scratch':
        from tfidf.scratch import tfidf
        from mat import cos_sim
        tfidf_mat = tfidf(bow)
        ans = cos_sim(tfidf_mat, tfidf_mat)
        print(ans)

if __name__ == '__main__':
    parser = ArgumentParser()
    parser.add_argument('--data', type=str)
    parser.add_argument('--method', type=str)
    args = parser.parse_args()
    main(args)